package SVN::TeamTools::CommitAnalyzer;

use warnings;
use strict;
use Carp;
use Error qw(:try);

use SVN::TeamTools::Store::Config;
use SVN::TeamTools::Store::Repo;
use SVN::TeamTools::Store::StatsDB;

use SVN::Look;
use Getopt::Long;

my $conf;
my $logger;
BEGIN { $conf = SVN::TeamTools::Store::Config->new(); $logger = $conf->{logger}; }

sub run {
	my $repo 	= SVN::TeamTools::Store::Repo-> new();
	my $stats 	= SVN::TeamTools::Store::StatsDB->new (create=>0);
	
	### Start build:
	my $lowerRev = $stats->lastRev();
	$lowerRev++;
	
	for (my $rev=$lowerRev; $rev<=$repo->getSvnRev(); $rev++) {
		$logger->info ("Analyzing commits (revision $rev)");
		$stats->addRev(rev => $rev);
	}
}
1;
